<template>
  <div class="shop_control">
    <!-- 头部 -->
    <div class="top">
      <div class="content">
        <div class="nav">
          <div></div>
          <p>商品详情</p>
        </div>
        <div class="top_btn">
          <el-button icon="el-icon-arrow-left" size="small" @click="goback"
            >返回</el-button
          >
        </div>
      </div>
    </div>
    <!-- 两个按钮 -->
    <div class="btn_box">
      <el-button>默认按钮</el-button>
      <el-button>默认按钮</el-button>
    </div>
    <!-- 基本信息 -->
    <el-card class="box-card">
      <div class="clearfix">
        <span class="el-icon-collection-tag"> 基本信息</span>
      </div>
      <table class="msg">
        <tr>
          <td class="bgc">ID</td>
          <td>8447466</td>
          <td class="bgc">商品名称</td>
          <td>通便贴</td>
          <td class="bgc">商品价格（元）</td>
          <td>69.90</td>
        </tr>
        <tr>
          <td class="bgc">商品类型</td>
          <td>主要产品</td>
          <td class="bgc">当前库存</td>
          <td>62</td>
          <td class="bgc">库存预警值</td>
          <td>10</td>
        </tr>
        <tr>
          <td class="bgc">商品状态</td>
          <td>已上架</td>
          <td class="bgc"></td>
          <td></td>
          <td class="bgc"></td>
          <td></td>
        </tr>
      </table>
      <!-- 订单记录 -->
      <div class="clearfix">
        <span class="el-icon-collection-tag"> 订单记录</span>
        <el-button style="float: right; padding: 3px 0" type="text"
          >添加商品</el-button
        >
      </div>
      <div class="data_list">
        <el-table
          :data="tableData"
          style="width: 100%"
          :header-cell-style="{ background: '#f5f5f5' }"
          border
        >
          <el-table-column prop="date" label="订单编号" width="150">
          </el-table-column>
          <el-table-column prop="name" label="提交时间" width="200">
          </el-table-column>
          <el-table-column prop="province" label="用户账号" width="150">
          </el-table-column>
          <el-table-column prop="city" label="订单金额" width="138">
          </el-table-column>
          <el-table-column prop="address" label="货款方式" width="150">
          </el-table-column>
          <el-table-column prop="zip" label="商品" width="150">
          </el-table-column>
          <el-table-column prop="zip" label="订单状态" width="150">
          </el-table-column>
          <el-table-column label="操作" width="150">
            <template slot-scope="scope">
              <el-button
                @click="handleClick(scope.row)"
                type="text"
                size="small"
                >查看订单</el-button
              >
            </template>
          </el-table-column>
        </el-table>
        <!-- 分页 -->
        <el-pagination
          background
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page.sync="currentPage"
          :page-sizes="[10, 20, 30, 40]"
          :page-size="10"
          layout=" prev, pager, next,sizes"
          :total="500"
        >
          >
        </el-pagination>
      </div>
    </el-card>
  </div>
</template>
  
  <script>
export default {
  name: "shop_control",
  data() {
    return {
      //商品名称
      shopName: "",
      //商品状态
      shopState: "",
      //商品类型
      shopType: "",
      //数据列表数据
      tableData: [
        {
          date: "201707196398345",
          name: "2017-07-19 14:48:38",
          province: "18000000000",
          city: "￥200.00",
          address: "货到付款",
          zip: " A*2、B*1",
        },
        {
          date: "201707196398345",
          name: "2017-07-19 14:48:38",
          province: "18000000000",
          city: "￥200.00",
          address: "货到付款",
          zip: "APP订单",
        },

        {
          date: "201707196398345",
          name: "2017-07-19 14:48:38",
          province: "18000000000",
          city: "￥200.00",
          address: "货到付款",
          zip: "APP订单",
        },
        {
          date: "201707196398345",
          name: "2017-07-19 14:48:38",
          province: "18000000000",
          city: "￥200.00",
          address: "货到付款",
          zip: "APP订单",
        },
        {
          date: "201707196398345",
          name: "2017-07-19 14:48:38",
          province: "18000000000",
          city: "￥200.00",
          address: "货到付款",
          zip: "APP订单",
        },
      ],
      currentPage: 1,
    };
  },
  methods: {
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
    handleClick(row) {
      console.log(row);
      this.$router.push("/shopInfo");
    },
    // 返回按钮
    goback() {
      this.$router.go(-1);
    },
  },
};
</script>
  
  <style lang="scss">
.shop_control {
  background-color: #f5f5f5;
  height: 100%;
  width: 100%;
}
//头部
.top {
  height: 50px;
  width: 100%;
  margin: 0 auto;
  background-color: #f3f3f3;
  border-bottom: 2px solid #e4e4e4;
  .content {
    margin: 0 auto;
    width: 1260px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .nav {
      width: 50%;
      height: 50%;
      display: flex;
      div {
        width: 3px;
        height: 100%;
        background-color: #00bfa0;
      }
      p {
        margin-left: 10px;
        height: 100%;
        line-height: 25px;
        font-size: 14px;
        color: #999999;
      }
    }
    .top_btn {
      width: 50%;
      text-align: right;
      .el-button {
        margin: 0;
        border-radius: 0;
        height: 50%;
      }
    }
  }
}
// 按钮盒
.btn_box {
  width: 1280px;
  margin: auto;
  margin-top: 30px;
}
//数据筛选
.box-card {
  width: 1280px;
  margin: 0 auto;
  margin-top: 30px;
  border-radius: 0;
  height: 100vh;
  position: relative;
}
.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}
.clearfix:after {
  clear: both;
}
.content_box {
  display: flex;
  justify-content: space-around;
  align-items: center;

  .child_box {
    width: 40%;
    height: 50%;
    display: flex;
    white-space: nowrap;
    line-height: 200%;
    .input_box {
      width: 65%;
    }
  }
}
//基本信息
.msg {
  width: 1200px;
  height: 200px;
  // text-align: center;
  margin: 30px;
  td {
    border: 1px solid gray;
    line-height: 60px;
    padding: 0 20px;
    box-sizing: border-box;
  }
  .bgc {
    background-color: #f9f9f9;
    text-align: right;
    width: 160px;
  }
}
.el-table-column {
  border: 1px solid gray;
}
// 分页
.el-pagination {
  margin: 20px 0;
  bottom: 30px;
  right: 30px;
  position: absolute;
}
</style>